let main=document.querySelector("#main")

//渲染商品信息
function proinfor(){
        let res;
        ajax({
            url: "http://chst.vip:1234/api/getinlanddiscount",
            success(res) {
                res = res.result;
                let html = "";
                res.forEach(item=> {
                    html += `
                    <div id="product">
                    <a href="../pages/inlandproduct.html?productid=${item.productId}">
                        <p>${item.productImg}</>
                        <h4>${item.productName}</h4>
                        <h5>${item.productPrice}</h5>
                        <span>${item.productFrom}:</span>
                        <em>${item.productTime}</em>
                    </a>
                    </div>`
                });
                main.innerHTML=html
            },
            error(err, xhr) {
                console.log(err);
            }
        })
    }
proinfor();